import "./index.css"
import $ from "jquery";
import { request } from "./ajax/ajax";
function recepte(dat) {
    console.log(dat)
    switch (dat.username) {
        case 1:
            console.log("管理员");
            window.location.replace("./manager.html")
            break;
        case 2:
            console.log("用户")
            window.location.replace("./user.html")
        default:
            break;
    }
}

document.getElementById("submit").onclick = function () {
    let username = $("username").val();
    let password = $("password").val();
    console.log(username)
    let json = {
        "username": username,
        "password": password
    }
    console.log(json)
    request("GET", "./response.json", json, recepte)
}
console.log("hello")